﻿@model IEnumerable<MvcApplication4.Models.Category>

@{
    Layout = null;
}

@foreach (var item in Model) {
    if (item.CategoryId % 2 == 0)
    {
        <div id = "Category_Box_Even">
            <div id="Category_Info">
                <div id = "Category_Info_text">@Html.ActionLink(Html.DisplayFor(modelItem => item.Title).ToString(), "CategorySelected", new { id = item.CategoryId })</div>
            </div>
            <div id="Category_Details">
                Created by @(Html.DisplayFor(modelItem => item.UserLink.UserName)) on @(Html.DisplayFor(modelItem => item.Time))
            </div>
        </div>
    }
    else
    {
        <div id = "Category_Box_Odd">
            <div id="Category_Info">
                <div id = "Category_Info_text">@Html.ActionLink(Html.DisplayFor(modelItem => item.Title).ToString(), "CategorySelected", new { id = item.CategoryId })</div>
            </div>
            <div id="Category_Details">
                Created by @(Html.DisplayFor(modelItem => item.UserLink.UserName)) on @(Html.DisplayFor(modelItem => item.Time))
            </div>
        </div>
    }
}
